@page "/treemap/rtl"

@using Syncfusion.Blazor.TreeMap
@inherits SampleBaseComponent;

<SampleDescription>
    <p>This sample orders the countries based on the unemployment rate by rendering treemap in the right-to-left (RTL) direction</p>
</SampleDescription>
<ActionDescription>
   <p> In this example, you can see how to render a treemap from the right-to-left direction. This example visualizes the list of countries based on the unemployment rate in treemap.</p>
   <p>More information about TreeMap can be found in this <a target='_blank' href='https://blazor.syncfusion.com/documentation/treemap/getting-started'>documentation section</a>.</p>
</ActionDescription>

<div class="control-section">
    <SfTreeMap EnableDrillDown="true" DataSource="@RtlData" EnableRtl="true" WeightValuePath="Size" Format="n" EnableGroupingSeparator="true" RenderDirection="RenderingMode.TopRightBottomLeft" Palette="@Palette">
        <TreeMapTitleSettings Text="List of Countries by Unemployment Rate"><TreeMapTitleTextStyle Size="15px"/></TreeMapTitleSettings>
        <TreeMapLeafItemSettings LabelPath="Name" ShowLabels="true"/>
        <TreeMapLevels>
            <TreeMapLevel GroupPath="Continent" HeaderAlignment="Alignment.Far">
                <TreeMapLevelBorder Color="#000000" Width="0.5"/>
            </TreeMapLevel>
            <TreeMapLevel GroupPath="Country" HeaderAlignment="Alignment.Far">
                <TreeMapLevelBorder Color="#000000" Width="0.5"/>
            </TreeMapLevel>
        </TreeMapLevels>
    </SfTreeMap>
    <div class="urllink">
        Source:
        <a href="https://www.indexmundi.com/facts/visualizations/treemap#SL.UEM.TOTL.ZS:SL.UEM.TOTL.ZS"
           target="_blank">www.indexmundi.com</a>
    </div>
</div>
@code{
    private string[] Palette = new string[] { "#5B244D", "#6F3953", "#87525A", "#A26F63", "#BA896B", "#D5A574", "F1C37D" };
    private List<object> RtlData { get; set; } = new List<object> {
        new {
            Continent =  new List<object> { new {
            Name="Africa",
            Size=519.70,
            Country= new List<object> { new {
                        Name="The Gambia",
                        Size=29.80
                    }, new {
                        Name="Lesotho",
                        Size=29.20
                    }, new {
                        Name="South Africa",
                        Size=27.30
                    }, new {
                        Name="Swaziland",
                        Size=25.70
                    }, new {
                        Name="Mozambique",
                        Size=24.50
                    }, new {
                        Name="Namibia",
                        Size=22.30
                    }, new {
                        Name="Comoros",
                        Size=20.10
                    }, new {
                        Name="Gabon",
                        Size=18.50
                    }, new {
                        Name="Botswana",
                        Size=18.10
                    }, new {
                        Name="Libya",
                        Size=17.70
                    }, new  {
                        Name="Tunisia",
                        Size=14.70
                    }, new {
                        Name="Sao Tome and principe",
                        Size=13.70
                    }, new {
                        Name="Congo",
                        Size=11.40
                    }, new  {
                        Name="Kenya",
                        Size=11.00
                    }, new {
                        Name="Monocco",
                        Size=10.80
                    }, new {
                        Name="Cabo Verde",
                        Size=10.70
                    }, new {
                        Name="Sudan",
                        Size=13.30
                    }, new {
                        Name="Mauritania",
                        Size=10.20
                    }, new {
                        Name="Mauritius",
                        Size=7.40
                    }, new {
                        Name="Zambia",
                        Size=7.40
                    }, new {
                        Name="Equatorial Guinea",
                        Size=6.70
                    }, new {
                        Name="Malawi",
                        Size=6.70
                    }, new {
                        Name="Mali",
                        Size=9.70
                    }, new {
                        Name="Eritrea",
                        Size=6.60
                    }, new {
                        Name="Togo",
                        Size=6.20
                    }, new {
                        Name="Djibouti",
                        Size=6.10
                    }, new {
                        Name="Guinea-Bissau",
                        Size=6.10
                    }, new {
                        Name="Somalia",
                        Size=6.00
                    }, new {
                        Name="Algeria",
                        Size=11.70
                    }, new {
                        Name="Senegal",
                        Size=9.50
                    }, new {
                        Name="Central African Republic",
                        Size=6.40
                    }, new {
                        Name="Chad",
                        Size=5.80
                    }, new {
                        Name="Ethiopia",
                        Size=5.40
                    }, new {
                        Name="Zimbabwe",
                        Size=5.30
                    }, new {
                        Name="Cameroon",
                        Size=4.50
                    }, new {
                        Name="Guinea",
                        Size=6.30
                    }, new {
                        Name="Ghana",
                        Size=5.80
                    }, new {
                        Name="Liberia",
                        Size=4.00
                    }, new {
                        Name="Burkina Faso",
                        Size=3.00
                    }, new {
                        Name="Sierra Leone",
                        Size=2.80
                    }, new {
                        Name="Tanzania",
                        Size=2.70
                    }, new {
                        Name="Egypt",
                        Size=11.60
                    }, new {
                        Name="Cote d'Ivoire",
                        Size=9.20
                    }, new {
                        Name="Angolia",
                        Size=6.20
                    }, new {
                        Name="Nigeria",
                        Size=5.50
                    }, new {
                        Name="Dem.Rep.Congo",
                        Size=3.60
                    }, new {
                        Name="Niger",
                        Size=2.60
                    }, new {
                        Name="Madagascar",
                        Size=2.40
                    }, new {
                        Name="Uganda",
                        Size=2.30
                    }, new {
                        Name="Rwanda",
                        Size=2.60
                    }, new {
                        Name="Burundi",
                        Size=1.60
                    }, new {
                        Name="Benin",
                        Size=1.00
                    }
            }
            } }
        },
    new {
         Continent= new List<object> { new {
            Name="Asia",
            Size=184.80,
            Country= new List<object> { new {
                        Name="Armenia",
                        Size=17.40
                    }, new {
                        Name="Tajikistan",
                        Size=10.80
                    }, new {
                        Name="Afghanistan",
                        Size=8.50
                    }, new {
                        Name="Pakistan",
                        Size=5.90
                    }, new {
                        Name="Philippines",
                        Size=5.70
                    }, new {
                        Name="Indonesia",
                        Size=5.60
                    }, new {
                        Name="Kazakhstan",
                        Size=5.40
                    }, new  {
                        Name="Georgia",
                        Size=11.50
                    }, new {
                        Name="Uzbekistan",
                        Size=8.70
                    }, new {
                        Name="Kyrgyz Republic",
                        Size=7.80
                    }, new {
                        Name="Russia",
                        Size=5.30
                    }, new {
                        Name="Sri Lanka",
                        Size=4.60
                    }, new {
                        Name="Dem.People's Rep.Korea",
                        Size=4.20
                    }, new {
                        Name="Timor-Leste",
                        Size=4.10
                    }, new {
                        Name="Brunai",
                        Size=6.40
                    }, new {
                        Name="Azerbaijan",
                        Size=5.10
                    }, new {
                        Name="Bangladesh",
                        Size=4.00
                    }, new {
                        Name="Hong Kong SAR, China",
                        Size=3.50
                    }, new {
                        Name="Malaysia",
                        Size=3.40
                    }, new {
                        Name="Nepal",
                        Size=3.20
                    }, new {
                        Name="Iran",
                        Size=11.40
                    }, new {
                        Name="Turkmenistan",
                        Size=8.60
                    }, new {
                         Name="Mongalia",
                         Size=6.40
                    }, new {
                        Name="China",
                        Size=4.60
                    }, new {
                        Name="Korea",
                        Size=3.70
                    }, new {
                        Name="Japan",
                        Size=2.90
                    }, new {
                        Name="Macao SAR, China",
                        Size=2.20
                    }, new {
                        Name="Vietnam",
                        Size=2.20
                    }, new {
                        Name="India",
                        Size=3.60
                    }, new {
                        Name="Bhutan",
                        Size=2.40
                    }, new {
                        Name="Singapore",
                        Size=2.10
                    }, new {
                        Name="Lao PDR",
                        Size=1.50
                    }, new {
                        Name="Myanmar",
                        Size=0.80
                    }, new {
                        Name="Thailand",
                        Size=1.00
                    }, new {
                        Name="Cambodia",
                        Size=0.30
                    }
            }
         } }
    },
    new
    {
        Continent = new List<object> { new {
            Name="South America",
            Size=94.50,
            Country = new List<object> { new {
                        Name="Brazil",
                        Size=13.40
                    }, new {
                        Name="Guyana",
                        Size=11.50
                    }, new {
                        Name="Colombia",
                        Size=9.10
                    }, new {
                        Name="Suri Name",
                        Size=8.90
                    }, new {
                        Name="Uruguay",
                        Size=8.30
                    }, new {
                        Name="Argentina",
                        Size=8.10
                    }, new {
                        Name="Chile",
                        Size=6.90
                    }, new {
                        Name="Peru",
                        Size=6.80
                    }, new {
                         Name="Venezuela",
                         Size=7.30
                    }, new {
                        Name="Paraguay",
                        Size=5.50
                    }, new {
                        Name="Ecuador",
                        Size=5.20
                    }, new {
                        Name="Bolivia",
                        Size=3.50
                    }
            }
            }
            }
        },
        new
        {
            Continent = new List<object> { new {
                Name="Europe",
                Size=361.10,
                Country = new List<object> { new {
                        Name="Bosnia and Herzegovina",
                        Size=25.80
                    }, new {
                        Name="Macedonia",
                        Size=24.40
                    }, new {
                        Name="Greece",
                        Size=23.10
                    }, new {
                        Name="Montenegro",
                        Size=17.70
                    }, new {
                        Name="Spain",
                        Size=17.40
                    }, new {
                        Name="Italy",
                        Size=11.60
                    }, new {
                        Name="Portugal",
                        Size=9.90
                    }, new {
                        Name="Latvia",
                        Size=9.40
                    }, new {
                        Name="Slovak Republic",
                        Size=9.00
                    }, new {
                        Name="Ukraine",
                        Size=9.00
                    }, new {
                        Name="Albania",
                        Size=15.00
                    }, new {
                        Name="Croatia",
                        Size=11.50
                    }, new {
                        Name="Finland",
                        Size=8.60
                    }, new {
                        Name="Estonia",
                        Size=7.30
                    }, new {
                        Name="Sweden",
                        Size=7.20
                    }, new {
                        Name="Denmark",
                        Size=6.30
                    }, new {
                        Name="Serbia",
                        Size=14.40
                    }, new {
                        Name="Turkey",
                        Size=11.40
                    }, new {
                        Name="Lithuania",
                        Size=8.10
                    }, new {
                        Name="Ireland",
                        Size=6.20
                    }, new {
                        Name="Bulgaria",
                        Size=6.00
                    }, new {
                        Name="Luxembourg",
                        Size=6.00
                    }, new {
                        Name="Romania",
                        Size=5.90
                    }, new {
                        Name="Slovenia",
                        Size=7.50
                    }, new {
                        Name="Austria",
                        Size=5.70
                    }, new {
                        Name="Malta",
                        Size=4.80
                    }, new {
                        Name="Switzerland",
                        Size=4.50
                    }, new {
                        Name="Moldova",
                        Size=4.40
                    }, new {
                        Name="Poland",
                        Size=5.10
                    }, new {
                        Name="United Kingdom",
                        Size=4.70
                    }, new {
                        Name="Hungary",
                        Size=4.20
                    }, new {
                        Name="Czech Republic",
                        Size=3.40
                    }, new {
                        Name="Cyprus",
                        Size=11.90
                    }, new {
                        Name="France",
                        Size=9.90
                    }, new {
                        Name="Belgium",
                        Size=7.40
                    }, new {
                        Name="Netherland",
                        Size=4.90
                    }, new {
                        Name="Norway",
                        Size=4.50
                    }, new {
                        Name="Germany",
                        Size=3.80
                    }, new {
                        Name="Iceland",
                        Size=2.70
                    }, new {
                        Name="Belarus",
                        Size=0.50
                    }}
            }
            }
        },
        new
        {
            Continent = new List<object> { new {
                Name="Central America and the Caribean",
                Size=170.60,
                Country=new List<object> { new {
                        Name="Dominican Republic",
                        Size=13.80
                    }, new {
                        Name="Bahamas",
                        Size=12.60
                    }, new {
                        Name="Puerto Rico",
                        Size=12.30
                    }, new {
                        Name="Haiti",
                        Size=13.40
                    }, new {
                        Name="Barbados",
                        Size=11.40
                    }, new {
                        Name="Costa Rica",
                        Size=8.50
                    }, new {
                        Name="El Salvador",
                        Size=6.90
                    }, new {
                        Name="Jamaica",
                        Size=13.00
                    }, new {
                        Name="Belize",
                        Size=11.40
                    }, new {
                        Name="Nicaragua",
                        Size=6.20
                    }, new {
                        Name="Panama",
                        Size=4.70
                    }, new {
                        Name="Honduras",
                        Size=5.70
                    }, new {
                        Name="Trinidad and Tobago",
                        Size=4.40
                    }, new {
                        Name="Cuba",
                        Size=2.60
                    }, new {
                        Name="Guatemala",
                        Size=2.60
                    }}
            } }
        },
        new
        {
            Continent = new List<object> { new {
                Name="Middle East",
                Size=101.90,
                Country = new List<object> { new {
                        Name="Oman",
                        Size=16.90
                    }, new {
                        Name="Yemen",
                        Size=16.00
                    }, new {
                        Name="Jordan",
                        Size=14.90
                    }, new {
                        Name="Syrian Arab Republic",
                        Size=14.20
                    }, new {
                        Name="Lebanon",
                        Size=6.70
                    }, new {
                        Name="Saudi Arabia",
                        Size=5.50
                    }, new {
                        Name="Iraq",
                        Size=14.80
                    }, new {
                        Name="Israel",
                        Size=4.40
                    }, new {
                        Name="United Arab Emirates",
                        Size=3.80
                    }, new {
                        Name="Kuwait",
                        Size=2.40
                    }, new {
                        Name="Bahrain",
                        Size=1.20
                    }, new {
                        Name="Qatar",
                        Size=0.30
                    } }
            }}
        }

    };

}
